DialogBox Question

Hi all,

i want to create a Dialogbox...

I need a function to close the DB, like i press "Yes" => Do something AND close the DB window

DB diaBox = create ("Test", styleStandard);
label(diaBox, "Test");

void closeBox(DB diaBox)
{
        hide diaBox     
        print "hide"
}
void yesOrder(DB diaBox)
{
    //Do something and close the window
        close(diaBox, false, closeBox) 
}

apply(diaBox, "YES", yesOrder);
show diaBox;

But if i press "YES" the window ("Test") is still openHalf


meinhana - Mon Aug 17 03:58:42 EDT 2015

Re: DialogBox Question
pommCannelle - Mon Aug 17 04:23:39 EDT 2015

hi !

I think the line 'close(diaBox, false, closeBox)' just attempts to define what to do when the close button is pressed.
Hereafter a working version of your code ;)

DB diaBox = create ("Test", styleStandard);
label(diaBox, "Test");

void closeBox(DB x){ hide x; destroy x }
void yesOrder(DB diaBox) {
    //Do something and close the window
    closeBox(diaBox) 
}

apply(diaBox, "YES", yesOrder);
close(diaBox, false, closeBox);
show diaBox;

 

Re: DialogBox Question
meinhana - Mon Aug 17 04:37:45 EDT 2015

pommCannelle - Mon Aug 17 04:23:39 EDT 2015

hi !

I think the line 'close(diaBox, false, closeBox)' just attempts to define what to do when the close button is pressed.
Hereafter a working version of your code ;)

DB diaBox = create ("Test", styleStandard);
label(diaBox, "Test");

void closeBox(DB x){ hide x; destroy x }
void yesOrder(DB diaBox) {
    //Do something and close the window
    closeBox(diaBox) 
}

apply(diaBox, "YES", yesOrder);
close(diaBox, false, closeBox);
show diaBox;

 

Thank you!